import { Context } from "koa";
import UserService from "../service/UserService";

class IndexController {
    async index(ctx: Context): Promise<any> {
        // const usp = new URLSearchParams(ctx.querystring)
        // console.log(usp.get('a'));
        
        // ctx.body = 'IndexController'

        // 数据库连接测试model->service->controller
        const user = await UserService.getUserByName('xfy');
        console.log('---IndexController');
        ctx.body = user
    }
}
export default new IndexController